#include "async.h"
#include "defs.h"
#include <vector>
#include <stdlib.h>

int
main(int argc, char** argv) {
	
	ThreadPool* pool1 = new ThreadPool(10);
	ThreadPool* pool2 = new ThreadPool(10);
	pool1->start();
	pool2->start();
	sleep(3);
	for (int i = 0; i < 1; i++){
		Job* job = new Job;
		char buf[3];
		snprintf(buf, 3, "%d", i);
		job->name = "Job #";
		job->name += buf;
//		job->delete_after_use = false;
		pool1->queue_job(job);
		pool2->queue_job(job);
		job->release();
	}

	sleep(5);
	pool1->stop();
	pool2->stop();
	delete pool1;
	delete pool2;
	return 0;
}
